//
//  CurrentViewController.m
//  DirectMember
//
//  Created by jzd on 2018/6/20.
//  Copyright © 2018年 宋佳. All rights reserved.
//

#import "CurrentViewController.h"
#import "CurrentCell.h"
#import "IntoMoneyController.h"

@interface CurrentViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableV;

@end

@implementation CurrentViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = @"活期";

    [self.tableV registerNib:[UINib nibWithNibName:NSStringFromClass([CurrentCell class]) bundle:nil] forCellReuseIdentifier:CurrentCellIdentifier];
    self.tableV.rowHeight = 44;
    
    /*
    UIBarButtonItem *turnIn = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"turnIn"] style:UIBarButtonItemStylePlain target:self action:@selector(turnInOnClick)];
    UIBarButtonItem *turnOut = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"turnOut"] style:UIBarButtonItemStylePlain target:self action:@selector(turnOutOnClick)];
    [turnIn setImageInsets:UIEdgeInsetsMake(0, 15, 0, -15)];
    self.navigationItem.rightBarButtonItems = @[turnOut,turnIn];
     */
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"money"] style:UIBarButtonItemStylePlain target:self action:@selector(moneyOnClick)];
}

-(void)moneyOnClick{
    IntoMoneyController *vc = [[IntoMoneyController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}

-(void)turnInOnClick{
    
}

-(void)turnOutOnClick{
    
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 7;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    CurrentCell *cell = [tableView dequeueReusableCellWithIdentifier:CurrentCellIdentifier];
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

@end
